<nav class="breadcrumb breadcrumb2 w-76p lf-255 edit-nav" id="pathContainer">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span class="menuLevel1">项目库</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-999 en menuLevel2">项目库管理</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">新增项目</span>
    <div class="f-r">
        <input class="btn btn-default size-S radius f-r mr-30 mt-5" type="button" id="gobackFromEdit" value="返回">
    </div>
</nav>

<!-- 新增、查看、编辑-弹窗 start-->
<div id="popup">
    <div class="pb-30 pb-30 pt-30">
        <div class="anchorBox clearfix clearfix2 w-71p" id="nav_item">
            <a class="active">企业信息</a>
            <a>就业名单</a>
        </div>
        <div class="mt-10 staticPosition pt-110" id="edit">
            <form class="form form-horizontal responsive" id="editForm" novalidate="novalidate" enctype="multipart/form-data"></form>
        </div>
    </div>

</div>
<!-- 新增、查看、编辑-弹窗 end -->
<style>
    .tableReset td { height: 38px; padding: 0; line-height: 0; padding-left: 5px; }
    .tableReset { width: 900px; }
</style>
<!-- 新增、查看、编辑-弹窗模板 start -->
<script id="editList" type="text/x-handlebars-template">
    <div class="clearfix basic" id="div0" style="width:1000px;">
        <input type="hidden" name="id" value="\{{id}}">
        <input type="hidden" name="province" value="河北省">
        <input type="hidden" name="city" value="邯郸市">
        <input type="hidden" name="area.id" id="natureId">
        <h3 class="clearfix h3Title" id="div1">企业信息</h3>
        <table class="table table-border table-bordered tableReset">
            <tr>
                <td>企业名称</td>
                <td colspan="2"> 　
                    <div class="inputDiv">
                        <input type="text" class="mccms-validate-required valid" sytle="width:500px" id="company_name" name="company_name" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{company_name}}" placeholder="请输入企业名称">
                    </div>
                </td>
                <td rowspan="6"> 　
                    <div class="bill-startup-card" style="250px;text-align:center">
                        <input type="file" name="file" id="a" style="250px;margin-top:8px" \{{#if detail}}hidden="hidden" \{{/if}} class="upload" onchange="doSelectPhotoChanged(this,0)" />
                        <img class="upload-show" src="" style="250px;margin:0 auto;margin-top:8px"/>
                        <input id='legal_person_pic' type="hidden" name="legal_person_pic" value=\{{legal_person_pic}}/>
                    </div>
                </td>
            </tr>
            <tr>
                <td>法人姓名</td>
                <td colspan="2"> 　
                    <div class="inputDiv" style="250px;">
                        <input type="text" class="mccms-validate-required" style="250px;" name="legal_person" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{legal_person}}" placeholder="请输入法人姓名">
                    </div>
                </td>
            </tr>
            <tr>
                <td>企业代码</td>
                <td colspan="2"> 　
                    <div class="inputDiv" style="250px;">
                        <input type="text" class="mccms-validate-required" style="250px;" name="company_dm" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{company_dm}}" placeholder="请输入企业代码">
                    </div>
                </td>
            </tr>
            <tr>
                <td>企业地址</td>
                <td colspan="2" style="250px;"> 　
                    <select class="select-box select radius" style="width:90px;" size="1" id="province" value="">
                        <option value="河北省" readOnly>河北省</option>
                    </select>
                    <label>-</label>
                    <select class="select-box select radius" style="width:90px;" size="1" id="city" value="">
                        <option value="邯郸市" readOnly>邯郸市</option>
                    </select>
                    <label>-</label>
                    <select class="select-box select radius" style="width:90px;" size="1" id="cty" value="">
                        <option value="魏县" readOnly>魏县</option>
                    </select>
                    <label>-</label>
                    <select class="select cl-select " style="width:90px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;" size="1" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{country}}" id="cry-add" name="c">
                    <option value="" selected>选择乡</option>
                    </select>
                    </br></br>
                    <label>&nbsp;&nbsp;&nbsp;&nbsp;村:</label>
                    <select class="select cl-select " style="width:80px;border-radius: 4px;margin:8px;" size="1" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{village}}" id="natrueName-add" name="n">
                    <option value="" selected>选择村</option>
                    </select>
                    <label>街道:</label>
                    <input type="text" style="vertical-align: middle;border: 1px solid #ddd;width: 50%;height: 38px;line-height: 38px;text-indent: 5px;font-size: 14px;border-radius: 4px;margin:8px;" name="street" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{street}}" placeholder="请输入街道">
                    <input type="hidden" value="河北省" id="h-province">
                    <input type="hidden" value="邯郸市" id="h-city">
                    <input type="hidden" value="魏县" id="h-cty" name='county'>
                    <input type="hidden" value="\{{country}}" name="country" id="s-cry-add" class="cryHidden">
                    <input type="hidden" value="\{{village}}" name="village" id="s-natrueName-add">
                </td>
            </tr>
            <tr>
                <td>地图坐标</td>
                <td colspan="2"> 　
                    <label>经度:</label>
                    <input type="text" style="vertical-align: middle;border: 1px solid #ddd;border-radius: 4px;width:100px;height: 38px;line-height: 38px;text-indent: 5px;font-size: 14px;" name="map_coordinates_y" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{map_coordinates_y}}">
                    <label>纬度:</label>
                    <input type="text" style="vertical-align: middle;border: 1px solid #ddd;width: 100px;height: 38px;line-height: 38px;text-indent: 5px;font-size: 14px;border-radius: 4px;" name="map_coordinates_x" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{map_coordinates_x}}">
                    <input class="btn btn-default size-S radius f-r mr-30 mt-5" type="button" id='mapBtn' value="地图" onclick="mapBtnFun()">
                </td>
            </tr>
            <tr>
                <td>联系电话</td>
                <td colspan="2">
                    <div class="inputDiv">
                        <input type="text" style="250px;" name="tel" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{tel}}" placeholder="请输入联系电话">
                    </div>
                    　
                </td>
            </tr>
            <tr>
                <td>企业经营范围</td>
                <td colspan="3">
                    <div class="formControls col-2">
                        <textarea class="input-text" style="min-height:60px;" \{{#if detail}}disabled="disabled" \{{/if}} name="business_scope" autocomplete="off" maxlength="100" value="\{{business_scope}}" placeholder="请输入最多100个字符...">\{{business_scope}}</textarea>
                    </div>
                    　
                </td>
            </tr>

            <tr>
                <td>主要经营项目</td>
                <td colspan="3">
                    <div class="inputDiv">
                        <input type="text" name="business_item" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{business_item}}" placeholder="请输入经营项目">
                    </div>
                    　
                </td>
            </tr>
            <tr>
                <td>注册金额</td>
                <td>
                    <div class="inputDiv">
                        <input type="number" class="mccms-validate-digits mccms-validate-min?0" style="250px;" name="registered_fund" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{registered_fund}}" placeholder="请输入注册资金">
                    </div>
                    　
                </td>
                <td>在职人数</td>
                <td>
                    <div class="inputDiv">
                        <input type="number" class="mccms-validate-digits mccms-validate-min?0" style="250px;" name="active_staff" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{active_staff}}" placeholder="请输入在职人数">
                    </div>
                    　
                </td>
            </tr>


            <tr>
                <td>入股人数</td>
                <td>
                    <div class="inputDiv">
                        <input type="number" class="mccms-validate-digits mccms-validate-min?0" style="250px;" name="stockholder_number" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{stockholder_number}}" placeholder="请输入入股人数">
                    </div>
                    　
                </td>
                <td>
                    <div class="inputDiv">
                    </div>
                    　
                </td>
                <td>
                    <div class="inputDiv">
                    </div>
                    　
                </td>
            </tr>

            <tr>
                <td>企业介绍</td>
                <td colspan="3">
                    <div class="formControls col-2">
                        <textarea class="input-text" style="min-height:60px;" \{{#if detail}}disabled="disabled" \{{/if}} name="company_profile" autocomplete="off" maxlength="100" value="\{{company_profile}}" placeholder="请输入最多100个字符...">\{{company_profile}}</textarea>
                    </div>
                    　
                </td>
            </tr>

            <tr>
                <td>荣获荣誉</td>
                <td colspan="3">
                    <div class="formControls col-2">
                        <textarea class="input-text" style="min-height:60px;" \{{#if detail}}disabled="disabled" \{{/if}} name="honor" autocomplete="off" maxlength="100" value="\{{honor}}" placeholder="请输入最多100个字符...">\{{honor}}</textarea>
                    </div>
                    　
                </td>
            </tr>
            <tr>
                <td>链接</td>
                <td colspan="3">
                    <div class="inputDiv">
                        <input type="text" name="link" \{{#if detail}}disabled="disabled" \{{/if}} value="\{{link}}" placeholder="请输入链接">
                    </div>
                    　
                </td>
            </tr>
        </table>
    </div>
    <!-- 就业名单 -->
    <div class="clearfix employmentListInfo" id="div1" style="width: 100%;margin: 0 auto 120px;">
        <h3 class="clearfix h3Title" id="div2">就业名单</h3>
        <div class="" style="width: 100%;height: 390px;overflow: scroll;">
            <table class="table table-border table-bordered">
                <thead class="text-c cl table-bgcolor-gary" id="thead">
                <tr>
                    <th>序号</th>
                    <th>任职方式</th>
                    <th>贫困户姓名</th>
                    <th>工种</th>
                    <th>月薪</th>
                    <th>工作时限</th>
                </tr>
                </thead>
                <tbody class="text-c cl" id="tbody1"></tbody>
            </table>
        </div>
        <!-- 分页 start -->
        <div class="page clearfix" style="width: 100%;margin-top: 0">
            <div class="f-l" style="white-space: nowrap;" id="pageContainer"></div>
            <div class="f-r" id="pageBtn" style="width: auto">
                <input type="button" value="首页" class="page-btn" id="firstPage">
                <input type="button" value="上一页" class="page-btn" id="prevPage">
                <input type="button" value="下一页" class="page-btn" id="nextPage">
                <input type="button" value="尾页" class="page-btn" id="lastPage">
            </div>
        </div>
        <!-- 分页 end -->
    </div>

    <div class="keepBtnBox" \{{#if detail}}hidden\{{/if}}>
    <button type="button" class="btn btn-secondary size-L sub_btn">保 存</button>
    </div>
</script>
<!-- 就业名单模板 start -->
<script id="List1" type="text/x-handlebars-template">
    \{{#each resultList}}
    <tr>
        <td>\{{Math @index '+' '1'}}</td>
        <td>\{{job_type}}</td>
        <td>\{{name}}</td>
        <td>\{{work_type}}</td>
        <td>\{{ monthly_salary}}</td>
        <td>\{{ work_time}}</td>
        <!--<td>
                \{{#mccmsShowIfEqual captain '1'}}是\{{/mccmsShowIfEqual}}
                \{{#mccmsShowIfEqual captain '0'}}否\{{/mccmsShowIfEqual}}
            </td>  -->
    </tr>
    \{{/each}}
</script>
<!-- 就业名单模板 end -->

<!-- 就业名单分页 start -->
<script id="page" type="text/x-handlebars-template">
    <span>共有\{{rowCount}}条记录，</span>
    <label for="ipt2">每页行数：</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageSize">
            <option value="10" selected>10</option>
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="200">200</option>
            <option value="300">300</option>
        </select>
    </span>
    <label for="ipt2">当前第</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageCount">
            \{{#each pageCount}}
            <option value="\{{pageCount}}">\{{pageCount}}</option>
            \{{/each}}
        </select>
    </span>
    <span>页</span>
</script>
<!-- 分页  end -->
<script>
    new projectLibraryEdit();
    $("#company_name").blur(function () {
        var company_name = $("#company_name").val();
        company_name && $.ajax({
            "url": '/company/checkCompanyName',
            "data": {
                "company_name": company_name
            },
            "method": "POST",
            "success": function (checkMsg) {
                if (checkMsg.status == '500') {
                    layer.msg("该企业名称已经存在！");
                }
            },
            "error": function (checkMsg) {
                if (checkMsg.status == '500') {
                    layer.msg("该企业名称已经存在！");
                }
            }
        });
    });

    function mapBtnFun() {
        window.currentPoint = null;
        if ($("input[name='map_coordinates_x']").val() && $("input[name='map_coordinates_y']").val()) {
            window.currentPoint = {lng: $("input[name='map_coordinates_y']").val(), lat: $("input[name='map_coordinates_x']").val()};
        }
        var index = layer.open({
            type: 2,
            title: '右键坐标拾取',
            content: '/templates/html/mapLatLng.html',
            area: ['1024px', '600px'],
            btn: ['完成'],
            yes: function () {
                if (window.currentPoint) {
                    $("input[name='map_coordinates_y']").val(window.currentPoint.lng);
                    $("input[name='map_coordinates_x']").val(window.currentPoint.lat);
                }
                layer.close(index);
            }
        });
    }
</script>


